
<?php 
 //*********************************
 //use the following pricing system: 
 //Under 5 is free, 5-12 years costs $4 and over 12 years is $6.
 //***********************************************************
 $t = 0; 
 $age = array(33, 35, 13, 8, 4); 
 foreach ($age as $a) 
 { 
 if ($a < 5) 
 {$p = 0;} 
 else 
 { 
 if ($a <12) 
 {$p = 4;} 
 else 
 {$p = 6;} 
 } 
 $t = $t + $p; 
 print "$" . $p . "<br>"; 
 } 
 print "The total is: $" . $t; 
 ?>
